home *** CD-ROM | disk | FTP | other *** search
- ' LMENUDMO.ASC -- MSDOS QuickBASIC LMENU.SUB subroutines demo 25 June 86
- ' by David L. Poskie (608) 274-9560
- ' 7118 Raymond Rd. Madison, WI 53719
- ' Please run any suggestions, corrections, additions, or changes by me.
- ' I can be messaged on all the major Madison, WI RBBS's.
-
- ' This demo takes you through using the subroutines, step-by-step
- ' You can alter these dimensions to fit your needs. As it stands,
- ' LMENU will handle up to 11 menus with 9 selections per menu.
- DIM Menu$(10 , 10) , NumSelects(10)
-
- GOTO Start
- ' I like the include files right up front -- they are in QBSUBnn.ARC.
- Rem $Include: 'LMENU.SUB'
- Rem $Include: 'OMNI.SUB'
-
- Start:
- COLOR 14 , 3 , 8 ' Arbitrary - anything you want
-
- LMenuData:
- ' Menu DATA begins -- replace with your own menu data.
- ' The prompt comes first,
- ' then menu selections,
- ' then terminator/s: ` * ' = end of that menu
- ' ` $ ' = end of all menus.
- ' Once you understand the format, there is no need for spaces
- ' in the DATA lines.
-
- ' Prompt Selections Terms
- DATA PROMPT ,Sel A,Sel B,Sel C,Sel D,None ,*
- DATA Ingredient ,Parsley,Sage,Rosemary,Thyme,Done ,*
- DATA Your Preference ,Life,Liberty,Pursuit of Happiness,EXIT ,*
- DATA Ready ,BIG <>,BIGGER <<>>,THE BIGGEST <<<>>>,Quit ,*
- DATA Aim ,EEENY,MEENY,MINEY,MOE,GO ,*
- DATA Fire ,One,Two,Three,Four,Five,Six,Seven,Eight,END ,* ,$
-
- '____________________END OF DATA______________________
-
- GOSUB LoadLMenu ' Load all menus
-
- SetMenu:
- CLS
- LOCATE 12 , 25
- PRINT "LMENU Line Menu Demonstration"
- LOCATE 25 , 19
- PRINT "Select Menu 0 -"; LMenuMax; "(anything else quits)";
- GOSUB GetKeyClear ' Get a key
- Num = KeyCode - 48 ' Convert to the actual menu number
- IF Num > LMenuMax _
- OR Num < 0 _
- THEN GOTO DemoExit ' Quit if out of bounds
- CLS
-
- GetSelNum:
- LOCATE 12 , 35
- PRINT "Select One"
- LOCATE 25,1 ' Locate the start of the menu line
- GOSUB LMenu ' Do the menu line
-
- ' The ONLY check the subroutine does is to convert Quit to -21. All other
- ' evaluation of KeyCode. or Q$ must be made in this calling program.
- IF KeyCode = -21 _
- THEN GOTO SetMenu ' Quit will ALWAYS be -21
- LOCATE 12 , 34 ' Evaluate the menu selection
- PRINT "You pressed"; KeyCode
- Dly = 2 ' Hold for 2 seconds
- GOSUB Delay
- LOCATE 12 , 34
- PRINT SPC(16)
- GOTO GetSelNum ' Return for further demonstration
-
- DemoExit:
- SYSTEM
- ' >>>> Physical EOF LMENUDMO.ASC 25 June 86